package com.shirley.designpattern.singleton;

/**
 * 懒汉式2 线程安全
 *
 * @author shirley
 */
public class Lazy2Singleton {
    private static Lazy2Singleton instance;

    private Lazy2Singleton() {
    }

    public static synchronized Lazy2Singleton getInstance() {
        if (instance == null) {
            instance = new Lazy2Singleton();
        }
        return instance;
    }
}